Conversation
|
The error is coming from upstream's pyproject.toml, starting at line 31: There are sections following it for different architectures, e.g.: Easiest is to add a patch for our needs, and I can take this as a task to try getting upstream. EDIT: I went to see how we build it for qemuriscv64 in Yocto (which also builds riscv64gc packages right now). Here's what I think is the key set of flags:
|
|
@luhenry my bad, my suggestion to rework the triggers broke our UI experience a bit (not actually seeing the workflows running anymore). I'm going to get a revert in and improve the logic. Here is the workflow you triggered: https://github.com/riseproject-dev/python-wheels/actions/runs/32887623280 |
Cython ships per-interpreter compiled wheels (cp39-cp315) plus a py3-none-any fallback on PyPI, but none for riscv64 -- which every source build of a Cython-using package on riscv64 needs (protobuf, fonttools, grpcio-tools, etc. all compile Cython from sdist today). Cython is self-hosting: setup.py compiles its own modules with the in-tree Cython, so the build-from-checkout shape needs no external build tool. Matrix is per-interpreter [cp312, cp313, cp314] with no cp314t -- setup.py disables self-compilation under Py_GIL_DISABLED, so a free-threaded build would silently ship the pure-Python fallback. The wheel test asserts a core module loaded from a compiled .so (a self-compile failure degrades to the pure-Python fallback silently) and then cythonizes+compiles+imports a module to prove the wheel works as a compiler end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CI build failed because upstream's pyproject.toml [tool.cibuildwheel]
config sets x86 CFLAGS (-march=core2 -mno-ssse3) with per-arch overrides
for aarch64/armv7l but none for riscv64, so the riscv64 build inherited
the x86 flags and gcc rejected them ("ISA string must begin with rv").
Add patches/cython/3.3.0/ with a riscv64 [tool.cibuildwheel] override
(applied matplotlib/pillow-style via a second checkout + git apply),
using the RVA-baseline flags used for riscv64gc builds. Also add
patches/cython/** to the PR paths trigger.
Replace the placeholder smoke test with upstream's own suite
(Tools/ci-run.sh): runtests.py over the bundled tests/, C and C++
backends. runtests.py + tests/ are copied into cibuildwheel's temp test
cwd (not the source Cython/) so the suite exercises the installed wheel,
not the checkout's pure-Python source.
Validated end-to-end under QEMU: cp312 wheel builds with 19 compiled
.so, and a runtests.py shard passes 186 tests against it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
EmbedTest chdirs to Demos/embed and the end-to-end srctrees compile fixtures from docs/ and invoke the root cython.py / cythonize.py, none of which were staged, so all three interpreters failed in runtests.py after building cleanly. Cython/ stays unstaged, so cython.py still resolves the compiler from the installed wheel.
EmbedTest and the embed_modules end-to-end case both link -lpython3.X, and the manylinux CPython is static-only with no shared libpython, so ld fails with "cannot find -lpython3.12". Not riscv64-specific: upstream runs these on runners that have a shared libpython. runtests.py gates EmbedTest on an exclude selector matching "embedded" (runtests.py:814); the srctree case matches its module name.
cython3.3.0Self-hosting:
setup.pycompiles Cython's own modules with the in-tree Cython. Upstream ships per-interpreter wheels plus apy3-none-anyfallback, but nothing for riscv64.Mirrors the
build_wheelsjob in upstream'swheels.yml.Matrix:
cp312,cp313,cp314. Nocp314t:setup.pydisables self-compilation underPy_GIL_DISABLED, so a free-threaded build would silently ship the pure-Python fallback.Testing
runtests.py(C and C++ backends), stagingruntests.py tests Demos docs cython.py cythonize.py.Cython/is deliberately not staged, so the installed wheel is imported rather than the source tree.-x embedded -x embed_modules— both link-lpython3.X, and manylinux CPython is static-only with no shared libpython. Not riscv64-specific.License: ✅
Patches
0001-Add-riscv64-cibuildwheel-environment-override.patch— To upstream [upstream has no riscv64 override].[tool.cibuildwheel.linux.environment]sets-march=core2, which the riscv64 compiler rejects; without it the C compile fails immediately. riscv64-only.